package com.uzhie.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.HandlerExecutionChain;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by TangFei on 2018/7/18.
 */
public class HttpDispatcherServlet extends DispatcherServlet {

    @Override
    public void init(ServletConfig config) throws ServletException {
        logger.trace("enter init method");
        super.init(config);
    }

    @Override
    public void destroy() {
        logger.trace("enter destroy method");
        super.destroy();
    }

    @Override
    protected void onRefresh(ApplicationContext context) {
        super.onRefresh(context);
    }

    @Override
    protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
        logger.trace("enter HttpDispatcherServlet doService");
        super.doService(request, response);
    }

    @Override
    protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
        logger.trace("enter HttpDispatcherServlet doDispatch");
        super.doDispatch(request, response);
    }

    @Override
    protected HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
        logger.trace("enter HttpDispatcherServlet getHandler");
        return super.getHandler(request);
    }


    @Override
    protected ModelAndView processHandlerException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        logger.trace("enter HttpDispatcherServlet processHandlerException", ex);
        return super.processHandlerException(request, response, handler, ex);
    }

}
